package com.itheima.pattern.factory.simple_factory;

// 简单咖啡工厂类，用来生产咖啡
public class SimpleCoffeeFactory {

    public Coffee createCoffee(String type) {
        Coffee coffee = null;
        if ("americano".equals(type)) {
            coffee = new AmericanCoffee();
        } else if ("latte".equals(type)) {
            coffee = new LatteCoffee();
        } else {
            System.out.println("没有该咖啡");
        }

        return coffee;
    }
}
